package com.example.backend.dao;


import com.example.backend.mapper.generator.AirPoMapper;
import com.example.backend.mapper.generator.HumidityPoMapper;
import com.example.backend.mapper.generator.TemperaturePoMapper;
import com.example.backend.mapper.po.AirPo;
import com.example.backend.mapper.po.AirPoExample;
import com.example.backend.mapper.po.HumidityPo;
import com.example.backend.mapper.po.TemperaturePo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Repository;

@Repository
public class MqttDao {

    private HumidityPoMapper humidityPoMapper;
    private TemperaturePoMapper temperaturePoMapper;
    private AirPoMapper airPoMapper;

    @Autowired
    @Lazy
    public MqttDao(HumidityPoMapper humidityPoMapper, TemperaturePoMapper temperaturePoMapper, AirPoMapper airPoMapper) {
        this.humidityPoMapper = humidityPoMapper;
        this.temperaturePoMapper = temperaturePoMapper;
        this.airPoMapper = airPoMapper;
    }

    public void insert(HumidityPo humidityPo) {
        this.humidityPoMapper.insert(humidityPo);
    }

    public void insert(TemperaturePo temperaturePo) {
        this.temperaturePoMapper.insert(temperaturePo);
    }

    public void insert(AirPo airPo) {
        this.airPoMapper.insert(airPo);
    }
}
